package com.unet.disk.disk.controller;

import java.util.Arrays;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.unet.disk.disk.entity.MemberNetdiskLogEntity;
import com.unet.disk.disk.service.MemberNetdiskLogService;
import com.unet.common.utils.PageUtils;
import com.unet.common.utils.R;



/**
 * 会员网盘操作日志
 *
 * @author hcfs
 * @email 599981113@qq.com
 * @date 2021-04-30 09:24:25
 */
@RestController
@RequestMapping("disk/membernetdisklog")
public class MemberNetdiskLogController {
    @Autowired
    private MemberNetdiskLogService memberNetdiskLogService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = memberNetdiskLogService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
		MemberNetdiskLogEntity memberNetdiskLog = memberNetdiskLogService.getById(id);

        return R.ok().put("memberNetdiskLog", memberNetdiskLog);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody MemberNetdiskLogEntity memberNetdiskLog){
		memberNetdiskLogService.save(memberNetdiskLog);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody MemberNetdiskLogEntity memberNetdiskLog){
		memberNetdiskLogService.updateById(memberNetdiskLog);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
		memberNetdiskLogService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
